package 笔试.美团;

import java.util.Scanner;

/**
 * @author:谢君臣
 * @Date:2021/8/15-8:22
 * @version:1.0
 * @function:
 */
public class MT81502 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String in = scanner.nextLine();
        int length = 0, i = 0;
        for (; i < in.length(); i++) {
            StringBuilder temp = new StringBuilder(in.substring(i));
            if (temp.reverse().toString().equals(in.substring(i))) {
                length = i;
                break;
            }
        }

        System.out.println(length);
    }
}
